<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\MemberLog
 *
 * @property int $id
 * @property string|null $nickname 用户名称
 * @property int|null $member_id
 * @property int|null $first_order_num 首推订单数
 * @property float|null $first_money 顶级提成
 * @property int|null $order_num 直推订单数
 * @property float|null $money 直推金额
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property float|null $total_money
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereFirstMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereFirstOrderNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereMemberId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereOrderNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereTotalMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\MemberLog whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class MemberLog extends Model
{
    protected $table="member_logs";

    public function getTotalMoneyAttribute($value)
    {
        return $this->attributes['first_money']+$this->attributes['money'];
    }
}
